home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_gen_torchlight2.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
2KB
|
84 lines
# Jones 3D Cog Script
#
# pyr_torch.cog
# An alternative to gen_torchlight if hardcoded values are preferable.
# Indy reach animation plays dependent on value of reach. Flame is present but invisible at startup
# Best use: Rename for target level and adjust hardcoded values as required.
#
# [SXC] [RKD]
#
# (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ========================================================================================
symbols
message activated
message startup
thing torch //the thing you light
thing flame nolink //flame, hidden at startup
thing player local
sound burning=gen_torch_burnin_c.wav local
vector minlite local
vector maxlite local
flex minradius=0.25 local
flex maxradius=0.3 local
flex reach=0 //0 for medium, 1 for high
flex islit=0 //set to 1 if torch lights at startup
flex flicker=1 //set to 0 to eliminate flicker
# subroutine
flex lightit=0.0 local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
minlite = VectorSet(0.87, 0.55, 0.06);
maxlite = VectorSet(0.89, 0.64, 0.30);
SetThingFlags(flame, 0x10);
SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.1);
if (islit) call lightit;
return;
# ........................................................................................
activated:
if (islit) return;
if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
PlayMode(player, (60 + reach), 0);
Sleep(0.5); //no return, falls through to lightit
# ........................................................................................
lightit:
ClearThingFlags(flame, 0x10);
SetThingLight(torch, minlite, 0.3, 0.5);
Sleep(0.5);
PlaySoundThing(burning, torch, 1, 3, 10, 1);
islit = 1;
if (flicker == 0) return;
ThingLightAnim(torch, minlite, minradius, maxlite, maxradius, 2);
return;
end